﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FaultBackService.BLL
{
    class TenMeanData
    {
        DAL.TenMeanData dal = new DAL.TenMeanData();

        /// <summary>
        /// 获取昨天的所有十分钟数据集合
        /// </summary>
        /// <returns></returns>
        internal IList<Models.TenMeanData> GetTenMeanListOfYesterday()
        {
            DateTime day = DateTime.Today.AddDays(-1);
            return GetList(day);
        }

        /// <summary>
        /// 获取某天的所有记录
        /// </summary>
        /// <param name="day"></param>
        /// <returns></returns>
        internal IList<Models.TenMeanData> GetList(DateTime day)
        {
            return dal.GetList(day);
        }

        /// <summary>
        /// 在数据库中写入多条记录
        /// </summary>
        /// <param name="tenMeanDataList"></param>
        internal void AddList(IList<Models.TenMeanData> tenMeanDataList)
        {
            dal.AddList(tenMeanDataList);
        }

        /// <summary>
        /// 获取故障数据库保存的最新十分钟数据
        /// </summary>
        /// <returns></returns>
        internal Models.TenMeanData GetLastOne()
        {
            return dal.GetLastOne();
        }
    }
}
